Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the tests to simplify attribute instance retrieval by replacing manual attribute iteration with helper methods from AttributeHelper.
- Replaced loops over Reflection attributes with AttributeHelper::getInstances and getFunctionInstances in various test files
- Added the AttributeHelper.php file and updated composer.json to autoload it for development
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/RequireExtendsTest.php | Uses AttributeHelper to retrieve attribute instances instead of manual iteration |
| tests/PureTest.php | Simplified pure attribute detection with getInstances |
| tests/PropertyWriteTest.php | Refactored property write retrieval to use the helper function |
| tests/PropertyTest.php | Updated to use AttributeHelper for property attribute extraction |
| tests/PropertyReadTest.php | Changed reflection attribute code to use the helper method |
| tests/ParamTest.php | Refactored parameter attribute retrieval with getFunctionInstances to merge parameters |
| tests/ParamOutTest.php | Converted attribute iteration to use the helper for ParamOut processing |
| tests/MixinTest.php | Uses the helper to fetch mixin classes |
| tests/MethodTest.php | Updated method attribute extraction using AttributeHelper |
| tests/IsReadOnlyTest.php | Simplified read-only attribute check with getInstances |
| tests/ImpureTest.php | Replaced manual impure attribute iteration with a helper function |
| tests/ImportTypeTest.php | Refactored import type attributes to use AttributeHelper |
| tests/ImmutableTest.php | Simplified immutable attribute check by using the helper function |
| tests/DeprecatedTest.php | Uses AttributeHelper to check for deprecated attributes rather than manual iteration |
| tests/DefineTypeTest.php | Refactored DefineType attribute extraction to use the helper method |
| tests/AttributeHelper.php | New file containing helper methods for retrieving attribute instances |
| tests/AssertTest.php | Updated assert attribute extraction to use getFunctionInstances |
| tests/AssertIfTrueTest.php | Refactored AssertIfTrue attribute gathering using the helper |
| tests/AssertIfFalseTest.php | Simplified AssertIfFalse attribute extraction with getFunctionInstances |
| composer.json | Updated autoload-dev configuration to load the new AttributeHelper file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor tests